package mornd.custom;

import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext;

/**
 * @author: mornd
 * @dateTime: 2023/5/9 - 17:03
 * 自定义 handlerMapping 和 handlerAdapter
 * 映射器：MyHandlerMapping
 * 处理器：Controller
 * 适配器：MyHandlerAdapter
 */
public class App {
    public static void main(String[] args) {
        AnnotationConfigServletWebServerApplicationContext context = new AnnotationConfigServletWebServerApplicationContext(WebConfig.class);
        MyHandlerMapping handlerMapping = context.getBean(MyHandlerMapping.class);

        handlerMapping.getHandlerMap().forEach((k,v) -> {
            System.out.println(k + "==>" + v);
        });
    }
}
